package com.itheima.zuoye.d08;

public class SilverCard extends Card {
    public SilverCard(int id, double balance) {
        super(id, balance);
    }

    @Override
    public void pay(double amount) {
        if (amount <=getBalance()) {
            setBalance(getBalance()-amount*0.85);  // 减去支付金额
            System.out.println("银卡支付成功，支付金额：" + amount + "，当前余额：" + getBalance());
        } else {
            System.out.println("余额不足，支付失败！");
        }
    }
}



